#include <iostream>
#include <CGraph.h>
#include <fstream>
#include <CEstimator.h>

using namespace std;

int main(int a, char** b) {

  CEstimator e;

  try {

    CGraph t;
    t.Initialize(1000);
    t.RenderGauss(500, 25, 1.0);
    t.SaveText("data/test_template.txt");

    t.Initialize(1000);
    t.RenderGauss(500, 25, 1.0);
    for (int i=0;i<t.Bins;i++)
      t.Val[i]+=CMath::RandomGauss()*0.15;
    t.SaveText("data/test_data1.txt");

    e.Setup("zestim.ini");
    e.Run();
  }
  catch (string l) {
    cout << endl <<l << endl;
    return 1;
  }
  catch (...) {
    cout << "Unknown, fucked-up error.. should not happen!" << endl;
    return 1;
  }
  return 0;
}
